//
//  KYBasicViewController.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/13.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYBasicViewController.h"
#import "UIImage+EX.h"
#import "MMDrawerController.h"
#import "UIViewController+MMDrawerController.h"

@interface KYBasicViewController ()

@end

@implementation KYBasicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setNav];
    
}
-(void)setNav{
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav"] forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
    [self addBackButton];
}
-(void)addBackButton{
    UIImage *backImage = [[UIImage imageNamed:@"nav_button_back_01"]orginalImage];
    UIBarButtonItem *back = [[UIBarButtonItem alloc]initWithImage:backImage  style:UIBarButtonItemStylePlain target:self action:@selector(backToLastVC)];
    UIBarButtonItem *fix = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
    fix.width = -15;
    self.navigationItem.leftBarButtonItems = @[fix,back];
}
-(void)backToLastVC{
    [self.navigationController popViewControllerAnimated:YES];
}

@end
